<template>
  <div id="app">
    <!-- 上工具栏 -->
    <div class="navgator">
      <div class="n_admin">闪嗨系统管理平台</div>
      <div class="n_manger">
        <div class="admin_manger">
          <img src="https://f12.baidu.com/it/u=2180474355,2821538409&fm=72" alt="">
          你好，管理员
        </div>
        <div class="admin_sign_out">
          <img class="sign_out" src="./assets/img/tc.png" alt=""> 
          退出
        </div>
      </div>
    </div>
    <!-- 下页面主体 -->
    <div class="main">
      <!-- 左侧边栏 -->
      <div class="sidebar">
      <!-- 准备菜单栏滚动 -->
      <!-- <div style="border:1px solid red"> -->
        <el-row class="tac">
          <el-col :span="12" style="width:100%">
            <el-menu
              default-active="1"
              class="el-menu-vertical-demo"
              text-color="#333"
              router 
              @open="handleOpen"
              @close="handleClose">
              <!-- 管理 -->
              <el-submenu index="1">
                <template slot="title">
                  <i class="fa fa-folder-o fa-lg"></i>
                  <span class="dis_left">管理</span>
                </template>
                <el-menu-item index="/">空间管理</el-menu-item>
                <el-menu-item index="/act">活动管理</el-menu-item>
                <el-menu-item index="1-3">用户管理</el-menu-item>
                <el-menu-item index="/user/account3">资金管理</el-menu-item>
              </el-submenu>
              <!-- 统计 -->
              <el-submenu index="2">
                <template slot="title">
                  <i class="fa fa-bar-chart-o fa-lg"></i>  
                  <span class="dis_left">统计</span>
                </template>
                <el-menu-item index="2-1">用户分析</el-menu-item>
                <el-menu-item index="2-2">订单分析</el-menu-item>
              </el-submenu>
              <!-- 开发 -->
              <el-submenu index="3">
                <template slot="title">
                  <i class="fa fa-code fa-lg"></i> 
                  <span class="dis_left">开发</span>
                </template>
                <el-menu-item index="3-1">基本配置</el-menu-item>
                <el-menu-item index="3-2">接入权限</el-menu-item>
              </el-submenu>
              <!-- 设置 -->
              <el-submenu index="4">
                <template slot="title">
                  <i class="fa fa-cog fa-lg"></i>
                  <span class="dis_left">设置</span>
                </template>
                <el-menu-item index="3-1">基本配置</el-menu-item>
                <el-menu-item index="3-2">接入权限</el-menu-item>
              </el-submenu>
            </el-menu>
          </el-col>
        </el-row>
      <!-- </div> -->
      </div>
      <!-- 右路由主体 -->
      <div class="content">
        <div class="c_router">
          <!-- 路由切换 -->
          <router-view/>
        </div>
      </div>
    </div>
    
  </div>
</template>

<script>
export default {
  name: 'App',
  methods:{
    handleOpen(key, keyPath) {
      console.log('key')
      console.log(key);
      console.log(keyPath);
    },
    handleClose(key, keyPath) {
      console.log('keyup')
      console.log(key);
      console.log(keyPath);
    }
  }
}
</script>

<style lang='scss' scoped>
$color:blue;
// 导航条
.navgator {
  position: fixed;
  top:0;
  left:0;
  bottom:0;
  right:0;
  height:64px;
  border:1px solid #ccc;
  background: #fff;
  display:flex;
  align-items:center;
  justify-content: space-between;
  box-shadow: 0 2px 4px 0 #ddd;
  z-index: 100;
  // 管理后台
  .n_admin {
    margin-left:36px;
  }
  // 管理员登录
  .n_manger {
    width:300px;
    // 头像
    .admin_manger { 
      display: inline-block;
      // border:1px solid red;
      img{
        width:40px;
        height:40px;
        vertical-align:middle;
        border:1px solid #ddd;
        border-radius: 50%;
        margin:0 8px 0 0;
      }
    }
    .admin_sign_out {
      margin:0 15px 0 40px;
      display: inline-block;
      // border:1px solid red;
      .sign_out {
        vertical-align:middle;
      }
    }
    
  }
}

.main {
  // 侧边栏
  .sidebar {
    width:200px;
    // height: 100%;
    position: fixed;
    left:10px;
    bottom:25px;
    right:0;
    top:74px;
    background: #fff;
    box-shadow: 2px 2px 4px 0 #ddd;
    .dis_left {
      margin-left:15px;
    }
    .fa {
      color:#4776E7;
    }
  }
  .content {
     margin-top:64px;
     background: #F4F6F8;
     border:1px solid #ccc;
     padding-bottom:25px;
    .c_router {
      margin:10px 10px 0 220px;
      min-height: 900px;
      background: #fff;
      box-shadow: 0 2px 4px 0 #ddd;
    }
  }
}

#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // color:$color;
}

</style>
